[hiptensor] Review and update all ACTOR_CRITIC kernel UIDs for contractions#7897
Open
evedovelli wants to merge 5 commits into
Open
[hiptensor] Review and update all ACTOR_CRITIC kernel UIDs for contractions#7897evedovelli wants to merge 5 commits into
evedovelli wants to merge 5 commits into
Conversation
…ctions All former kernels with KPerBlock7=16 became invalid in Composable Kernel. This change adds scripts to run all required variations contractions and probe for the most efficient kernels, and update the code with the obtained results. The selected kernels were the best performing kernels on gfx950 and on gfx1201 (for date and compute combin ations not available on gfx950).
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes hipTensor ACTOR_CRITIC contraction kernel selection failures after a Composable Kernel update by updating hard-coded actor-critic kernel UID strings to match currently compiled CK kernel names, and adds scripts to re-probe/patch these UIDs for future CK changes.
Changes:
- Updated ActorCritic(Selection|SelectionUnaryOps)
unique_idkernel-name strings incontraction_selection.cppto match the current CK contraction instance names. - Removed stale
rank == 2 && dim1special-case selection branches in row-major bilinear specializations (no longer valid with current CK instances). - Added a small probe/patch script toolset to regenerate and apply winning kernel UIDs from DEFAULT_PATIENT brute-force runs.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| projects/hiptensor/scripts/update_actor_critic/probe_actor_critic.py | New probe script to brute-force DEFAULT_PATIENT winners and write per-(type,layout,rank) kernel-name results to JSON. |
| projects/hiptensor/scripts/update_actor_critic/patch_actor_critic.py | New patch script to merge probe JSONs and update unique_id strings in contraction_selection.cpp. |
| projects/hiptensor/scripts/update_actor_critic/_actor_critic_combos.py | Shared definitions/helpers for probe YAML generation and parsing brute-force perf logs. |
| projects/hiptensor/library/src/contraction/contraction_selection.cpp | Updates ACTOR_CRITIC kernel UID strings and removes obsolete rank2/dim1 row-major bilinear branches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HIPTENSOR_ALGO_ACTOR_CRITIC contraction tests were failing with HIPTENSOR_STATUS_EXECUTION_FAILED on all data types and ranks after a Composable Kernel update. The root cause was a CK commit
(ROCm/composable_kernel@e58096d, "add composable kernel support on gfx1250") that changed all F16/BF16/F32 contraction instances from KPerBlock=16 to KPerBlock=32. The
hard-coded unique_id kernel name strings in ActorCritic[UnaryOps]Selection in contraction_selection.cpp still referenced KPerBlock=16, so findByKernelName returned nullptr for every actor-critic lookup.
This change fixes these invalid kernel selections and add a set the scripts to aid on probing and patching new kernel UIDs in the future.
Changes
library/src/contraction/contraction_selection.cpp
HIPTENSOR_ALGO_DEFAULT_PATIENT brute-force timing on gfx950 (F16/BF16/F32/F64) and gfx1201 (data/compute type combinations not available on gfx950), then taking the best-performing kernel per (type, layout, rank) slot.
longer exists in CK.
scripts/update_actor_critic/ (new)
A three-script toolset to re-derive and apply correct actor-critic kernel names after any future CK kernel parameter changes, without needing to manually inspect kernel name strings.
log parsing.
Test Plan and Results
Submission Checklist